package com.hzhr.iot.user.convertor;

import com.hzhr.iot.user.convertor.custom.*;
import com.hzhr.iot.core.util.HzhrTypeUtil;
import com.hzhr.iot.core.util.HzhrJsonUtil;
import java.util.Map;
import com.hzhr.iot.user.model.dept.DeptModel;
import com.hzhr.iot.user.model.dept.DeptPostModel;
import com.hzhr.iot.user.entity.DeptEntity;
import com.hzhr.iot.user.entity.ext.DeptEntityExt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.hzhr.iot.user.model.dept.DeptModel;
import com.hzhr.iot.user.model.dept.DeptGetModel;
import com.hzhr.iot.user.model.dept.DeptPostModel;
import com.hzhr.iot.user.model.dept_name.Dept_NameModel;
import com.hzhr.iot.user.model.dept_name.Dept_NameGetModel;
import com.hzhr.iot.user.model.dept_name.Dept_NamePutModel;
import com.hzhr.iot.user.model.dept_parentId.Dept_ParentIdModel;
import com.hzhr.iot.user.model.dept_parentId.Dept_ParentIdGetModel;
import com.hzhr.iot.user.model.dept_parentId.Dept_ParentIdPutModel;
import com.hzhr.iot.user.queryModel.custom.DeptCustomQueryModel;

@Component
public class DeptConvertor {
    @Autowired
    ActionCustomConvertor actionCustomConvertor;
    @Autowired
    ActionInRoleCustomConvertor actionInRoleCustomConvertor;
    @Autowired
    CompanyCustomConvertor companyCustomConvertor;
    @Autowired
    OptionsCustomConvertor optionsCustomConvertor;
    @Autowired
    ResourceCustomConvertor resourceCustomConvertor;
    @Autowired
    ResourceInActionCustomConvertor resourceInActionCustomConvertor;
    @Autowired
    RoleCustomConvertor roleCustomConvertor;
    @Autowired
    UserCustomConvertor userCustomConvertor;
    @Autowired
    UserInRoleCustomConvertor userInRoleCustomConvertor;

    public DeptEntity deptModel2entity(DeptModel in) {
        //未转换字段: createUserId createTime updateUserId isValid outId updateTime state 
        if (in == null) return null;
        DeptEntity result = new DeptEntity();

        result.setId(HzhrTypeUtil.integer2integer(in.getId()));
        result.setName(HzhrTypeUtil.string2string(in.getName()));
        result.setCode(HzhrTypeUtil.string2string(in.getCode()));
        result.setLevel(HzhrTypeUtil.integer2integer(in.getLevel()));
        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        result.setParentName(HzhrTypeUtil.string2string(in.getParentName()));
        result.setCompanyId(HzhrTypeUtil.integer2integer(in.getCompanyId()));
        result.setResourceCode(HzhrTypeUtil.string2string(in.getResourceCode()));
        return result;
    }
    public DeptEntity deptModel2entity(DeptModel in, DeptEntity ori) {
        //未转换字段: createUserId createTime updateUserId isValid outId updateTime state 
        if (in == null) return null;
        DeptEntity result = ori;

        result.setId(HzhrTypeUtil.integer2integer(in.getId()));
        result.setName(HzhrTypeUtil.string2string(in.getName()));
        result.setCode(HzhrTypeUtil.string2string(in.getCode()));
        result.setLevel(HzhrTypeUtil.integer2integer(in.getLevel()));
        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        result.setParentName(HzhrTypeUtil.string2string(in.getParentName()));
        result.setCompanyId(HzhrTypeUtil.integer2integer(in.getCompanyId()));
        result.setResourceCode(HzhrTypeUtil.string2string(in.getResourceCode()));
        return result;
    }
    public List<DeptEntity> deptModelList2entityList(List<DeptModel> in) {
        if (in == null) return null;
        List<DeptEntity> result = new ArrayList<>();
        for (DeptModel item : in) {
            result.add(deptModel2entity(item));
        }
        return result;
    }
    public DeptModel entity2deptModel(DeptEntity in) {
        //未转换字段: managementName subCompanyName 
        if (in == null) return null;
        DeptModel result = new DeptModel();

        result.setId(HzhrTypeUtil.integer2integer(in.getId()));
        result.setName(HzhrTypeUtil.string2string(in.getName()));
        result.setCode(HzhrTypeUtil.string2string(in.getCode()));
        result.setLevel(HzhrTypeUtil.integer2integer(in.getLevel()));
        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        result.setParentName(HzhrTypeUtil.string2string(in.getParentName()));
        result.setCompanyId(HzhrTypeUtil.integer2integer(in.getCompanyId()));
        result.setResourceCode(HzhrTypeUtil.string2string(in.getResourceCode()));
        return result;
    }
    public List<DeptModel> entityList2deptModelList(List<DeptEntity> in) {
        if (in == null) return null;
        List<DeptModel> result = new ArrayList<>();
        for (DeptEntity item : in) {
            result.add(entity2deptModel(item));
        }
        return result;
    }
    public DeptModel ext2deptModel(DeptEntityExt in) {
        //未转换字段: managementName subCompanyName 
        if (in == null) return null;
        DeptModel result = new DeptModel();

        result.setId(HzhrTypeUtil.integer2integer(in.getId()));
        result.setName(HzhrTypeUtil.string2string(in.getName()));
        result.setCode(HzhrTypeUtil.string2string(in.getCode()));
        result.setLevel(HzhrTypeUtil.integer2integer(in.getLevel()));
        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        result.setParentName(HzhrTypeUtil.string2string(in.getParentName()));
        result.setCompanyId(HzhrTypeUtil.integer2integer(in.getCompanyId()));
        result.setResourceCode(HzhrTypeUtil.string2string(in.getResourceCode()));
        return result;
    }
    public List<DeptModel> extList2deptModelList(List<DeptEntityExt> in) {
        if (in == null) return null;
        List<DeptModel> result = new ArrayList<>();
        for (DeptEntityExt item : in) {
            result.add(ext2deptModel(item));
        }
        return result;
    }
    public DeptGetModel extList2deptGetModel(List<DeptEntityExt> extList, Integer total, Integer changeCount, Map<String, Object> query) {
        List<DeptModel> modelList = extList2deptModelList(extList);
        if (modelList == null) {
            DeptGetModel result = new DeptGetModel();
            result.setTotal(total);
            result.setChangeCount(changeCount);
            return result;
        }

         String _show = HzhrTypeUtil.object2string(query.get("_show"));
         Boolean _show_subCompanyName = query.get("_show_subCompanyName") != null ? Boolean.parseBoolean(query.get("_show_subCompanyName").toString()) : false;
         Boolean _show_info = query.get("_show_info") != null ? Boolean.parseBoolean(query.get("_show_info").toString()) : false;
         Boolean _show_managementName = query.get("_show_managementName") != null ? Boolean.parseBoolean(query.get("_show_managementName").toString()) : false;

        if (!_show_subCompanyName) {
            for (DeptModel model : modelList) {
                model.setSubCompanyName(null);
            }
        }
        if (!_show_info) {
            for (DeptModel model : modelList) {
                model.setName(null);
                model.setCode(null);
                model.setLevel(null);
                model.setParentId(null);
                model.setParentName(null);
                model.setCompanyId(null);
                model.setResourceCode(null);
            }
        }
        if (!_show_managementName) {
            for (DeptModel model : modelList) {
                model.setManagementName(null);
            }
        }

        DeptGetModel result = new DeptGetModel();
        if ("one".equals(_show)) {
            if (modelList.size() > 0) {
                result.setModel(modelList.get(0));
            }
         }
        if ("list".equals(_show)) {
            result.setModelList(modelList);
        }
        result.setTotal(total);
        result.setChangeCount(changeCount);
        return result;
    }
    public DeptGetModel entity2deptGetModel(DeptEntity entity, Integer total, Integer changeCount, Map<String, Object> query) {
        List<DeptEntityExt> extList = new ArrayList<>();
        if (entity == null) return extList2deptGetModel(extList, total, changeCount, query);
        extList.add(HzhrJsonUtil.convertObjectType(entity, DeptEntityExt.class));
        return extList2deptGetModel(extList, total, changeCount, query);
     }
    public DeptEntity deptPostModel2entity(DeptPostModel in) {
        //未转换字段: createUserId code level updateUserId isValid updateTime parentName companyId resourceCode createTime outId id state 
        if (in == null) return null;
        DeptEntity result = new DeptEntity();

        result.setName(HzhrTypeUtil.string2string(in.getName()));
        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        return result;
    }
    public DeptEntity deptPostModel2entity(DeptPostModel in, DeptEntity ori) {
        //未转换字段: createUserId code level updateUserId isValid updateTime parentName companyId resourceCode createTime outId id state 
        if (in == null) return null;
        DeptEntity result = ori;

        result.setName(HzhrTypeUtil.string2string(in.getName()));
        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        return result;
    }
    public List<DeptEntity> deptPostModelList2entityList(List<DeptPostModel> in) {
        if (in == null) return null;
        List<DeptEntity> result = new ArrayList<>();
        for (DeptPostModel item : in) {
            result.add(deptPostModel2entity(item));
        }
        return result;
    }
    public DeptPostModel entity2deptPostModel(DeptEntity in) {
        //未转换字段: 
        if (in == null) return null;
        DeptPostModel result = new DeptPostModel();

        result.setName(HzhrTypeUtil.string2string(in.getName()));
        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        return result;
    }
    public List<DeptPostModel> entityList2deptPostModelList(List<DeptEntity> in) {
        if (in == null) return null;
        List<DeptPostModel> result = new ArrayList<>();
        for (DeptEntity item : in) {
            result.add(entity2deptPostModel(item));
        }
        return result;
    }
    public DeptPostModel ext2deptPostModel(DeptEntityExt in) {
        //未转换字段: 
        if (in == null) return null;
        DeptPostModel result = new DeptPostModel();

        result.setName(HzhrTypeUtil.string2string(in.getName()));
        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        return result;
    }
    public List<DeptPostModel> extList2deptPostModelList(List<DeptEntityExt> in) {
        if (in == null) return null;
        List<DeptPostModel> result = new ArrayList<>();
        for (DeptEntityExt item : in) {
            result.add(ext2deptPostModel(item));
        }
        return result;
    }
    public DeptEntity dept_NameModel2entity(Dept_NameModel in) {
        //未转换字段: parentName companyId createUserId resourceCode level createTime updateUserId isValid outId updateTime state parentId 
        if (in == null) return null;
        DeptEntity result = new DeptEntity();

        result.setId(HzhrTypeUtil.integer2integer(in.getId()));
        result.setName(HzhrTypeUtil.string2string(in.getName()));
        result.setCode(HzhrTypeUtil.string2string(in.getCode()));
        return result;
    }
    public DeptEntity dept_NameModel2entity(Dept_NameModel in, DeptEntity ori) {
        //未转换字段: parentName companyId createUserId resourceCode level createTime updateUserId isValid outId updateTime state parentId 
        if (in == null) return null;
        DeptEntity result = ori;

        result.setId(HzhrTypeUtil.integer2integer(in.getId()));
        result.setName(HzhrTypeUtil.string2string(in.getName()));
        result.setCode(HzhrTypeUtil.string2string(in.getCode()));
        return result;
    }
    public List<DeptEntity> dept_NameModelList2entityList(List<Dept_NameModel> in) {
        if (in == null) return null;
        List<DeptEntity> result = new ArrayList<>();
        for (Dept_NameModel item : in) {
            result.add(dept_NameModel2entity(item));
        }
        return result;
    }
    public Dept_NameModel entity2dept_NameModel(DeptEntity in) {
        //未转换字段: 
        if (in == null) return null;
        Dept_NameModel result = new Dept_NameModel();

        result.setId(HzhrTypeUtil.integer2integer(in.getId()));
        result.setName(HzhrTypeUtil.string2string(in.getName()));
        result.setCode(HzhrTypeUtil.string2string(in.getCode()));
        return result;
    }
    public List<Dept_NameModel> entityList2dept_NameModelList(List<DeptEntity> in) {
        if (in == null) return null;
        List<Dept_NameModel> result = new ArrayList<>();
        for (DeptEntity item : in) {
            result.add(entity2dept_NameModel(item));
        }
        return result;
    }
    public Dept_NameModel ext2dept_NameModel(DeptEntityExt in) {
        //未转换字段: 
        if (in == null) return null;
        Dept_NameModel result = new Dept_NameModel();

        result.setId(HzhrTypeUtil.integer2integer(in.getId()));
        result.setName(HzhrTypeUtil.string2string(in.getName()));
        result.setCode(HzhrTypeUtil.string2string(in.getCode()));
        return result;
    }
    public List<Dept_NameModel> extList2dept_NameModelList(List<DeptEntityExt> in) {
        if (in == null) return null;
        List<Dept_NameModel> result = new ArrayList<>();
        for (DeptEntityExt item : in) {
            result.add(ext2dept_NameModel(item));
        }
        return result;
    }
    public Dept_NameGetModel extList2dept_NameGetModel(List<DeptEntityExt> extList, Integer total, Integer changeCount, Map<String, Object> query) {
        List<Dept_NameModel> modelList = extList2dept_NameModelList(extList);
        if (modelList == null) {
            Dept_NameGetModel result = new Dept_NameGetModel();
            result.setTotal(total);
            result.setChangeCount(changeCount);
            return result;
        }

         String _show = HzhrTypeUtil.object2string(query.get("_show"));
         Boolean _show_info = query.get("_show_info") != null ? Boolean.parseBoolean(query.get("_show_info").toString()) : false;

        if (!_show_info) {
            for (Dept_NameModel model : modelList) {
                model.setName(null);
                model.setCode(null);
            }
        }

        Dept_NameGetModel result = new Dept_NameGetModel();
        if ("one".equals(_show)) {
            if (modelList.size() > 0) {
                result.setModel(modelList.get(0));
            }
         }
        if ("list".equals(_show)) {
            result.setModelList(modelList);
        }
        result.setTotal(total);
        result.setChangeCount(changeCount);
        return result;
    }
    public Dept_NameGetModel entity2dept_NameGetModel(DeptEntity entity, Integer total, Integer changeCount, Map<String, Object> query) {
        List<DeptEntityExt> extList = new ArrayList<>();
        if (entity == null) return extList2dept_NameGetModel(extList, total, changeCount, query);
        extList.add(HzhrJsonUtil.convertObjectType(entity, DeptEntityExt.class));
        return extList2dept_NameGetModel(extList, total, changeCount, query);
     }
    public DeptEntity dept_NamePutModel2entity(Dept_NamePutModel in) {
        //未转换字段: createUserId code level updateUserId isValid updateTime parentId parentName companyId resourceCode createTime outId id state 
        if (in == null) return null;
        DeptEntity result = new DeptEntity();

        result.setName(HzhrTypeUtil.string2string(in.getName()));
        return result;
    }
    public DeptEntity dept_NamePutModel2entity(Dept_NamePutModel in, DeptEntity ori) {
        //未转换字段: createUserId code level updateUserId isValid updateTime parentId parentName companyId resourceCode createTime outId id state 
        if (in == null) return null;
        DeptEntity result = ori;

        result.setName(HzhrTypeUtil.string2string(in.getName()));
        return result;
    }
    public List<DeptEntity> dept_NamePutModelList2entityList(List<Dept_NamePutModel> in) {
        if (in == null) return null;
        List<DeptEntity> result = new ArrayList<>();
        for (Dept_NamePutModel item : in) {
            result.add(dept_NamePutModel2entity(item));
        }
        return result;
    }
    public Dept_NamePutModel entity2dept_NamePutModel(DeptEntity in) {
        //未转换字段: 
        if (in == null) return null;
        Dept_NamePutModel result = new Dept_NamePutModel();

        result.setName(HzhrTypeUtil.string2string(in.getName()));
        return result;
    }
    public List<Dept_NamePutModel> entityList2dept_NamePutModelList(List<DeptEntity> in) {
        if (in == null) return null;
        List<Dept_NamePutModel> result = new ArrayList<>();
        for (DeptEntity item : in) {
            result.add(entity2dept_NamePutModel(item));
        }
        return result;
    }
    public Dept_NamePutModel ext2dept_NamePutModel(DeptEntityExt in) {
        //未转换字段: 
        if (in == null) return null;
        Dept_NamePutModel result = new Dept_NamePutModel();

        result.setName(HzhrTypeUtil.string2string(in.getName()));
        return result;
    }
    public List<Dept_NamePutModel> extList2dept_NamePutModelList(List<DeptEntityExt> in) {
        if (in == null) return null;
        List<Dept_NamePutModel> result = new ArrayList<>();
        for (DeptEntityExt item : in) {
            result.add(ext2dept_NamePutModel(item));
        }
        return result;
    }
    public DeptEntity dept_ParentIdModel2entity(Dept_ParentIdModel in) {
        //未转换字段: createUserId code level updateUserId isValid updateTime parentName companyId resourceCode createTime name outId state 
        if (in == null) return null;
        DeptEntity result = new DeptEntity();

        result.setId(HzhrTypeUtil.integer2integer(in.getId()));
        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        return result;
    }
    public DeptEntity dept_ParentIdModel2entity(Dept_ParentIdModel in, DeptEntity ori) {
        //未转换字段: createUserId code level updateUserId isValid updateTime parentName companyId resourceCode createTime name outId state 
        if (in == null) return null;
        DeptEntity result = ori;

        result.setId(HzhrTypeUtil.integer2integer(in.getId()));
        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        return result;
    }
    public List<DeptEntity> dept_ParentIdModelList2entityList(List<Dept_ParentIdModel> in) {
        if (in == null) return null;
        List<DeptEntity> result = new ArrayList<>();
        for (Dept_ParentIdModel item : in) {
            result.add(dept_ParentIdModel2entity(item));
        }
        return result;
    }
    public Dept_ParentIdModel entity2dept_ParentIdModel(DeptEntity in) {
        //未转换字段: 
        if (in == null) return null;
        Dept_ParentIdModel result = new Dept_ParentIdModel();

        result.setId(HzhrTypeUtil.integer2integer(in.getId()));
        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        return result;
    }
    public List<Dept_ParentIdModel> entityList2dept_ParentIdModelList(List<DeptEntity> in) {
        if (in == null) return null;
        List<Dept_ParentIdModel> result = new ArrayList<>();
        for (DeptEntity item : in) {
            result.add(entity2dept_ParentIdModel(item));
        }
        return result;
    }
    public Dept_ParentIdModel ext2dept_ParentIdModel(DeptEntityExt in) {
        //未转换字段: 
        if (in == null) return null;
        Dept_ParentIdModel result = new Dept_ParentIdModel();

        result.setId(HzhrTypeUtil.integer2integer(in.getId()));
        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        return result;
    }
    public List<Dept_ParentIdModel> extList2dept_ParentIdModelList(List<DeptEntityExt> in) {
        if (in == null) return null;
        List<Dept_ParentIdModel> result = new ArrayList<>();
        for (DeptEntityExt item : in) {
            result.add(ext2dept_ParentIdModel(item));
        }
        return result;
    }
    public Dept_ParentIdGetModel extList2dept_ParentIdGetModel(List<DeptEntityExt> extList, Integer total, Integer changeCount, Map<String, Object> query) {
        List<Dept_ParentIdModel> modelList = extList2dept_ParentIdModelList(extList);
        if (modelList == null) {
            Dept_ParentIdGetModel result = new Dept_ParentIdGetModel();
            result.setTotal(total);
            result.setChangeCount(changeCount);
            return result;
        }

         String _show = HzhrTypeUtil.object2string(query.get("_show"));
         Boolean _show_info = query.get("_show_info") != null ? Boolean.parseBoolean(query.get("_show_info").toString()) : false;

        if (!_show_info) {
            for (Dept_ParentIdModel model : modelList) {
                model.setParentId(null);
            }
        }

        Dept_ParentIdGetModel result = new Dept_ParentIdGetModel();
        if ("one".equals(_show)) {
            if (modelList.size() > 0) {
                result.setModel(modelList.get(0));
            }
         }
        if ("list".equals(_show)) {
            result.setModelList(modelList);
        }
        result.setTotal(total);
        result.setChangeCount(changeCount);
        return result;
    }
    public Dept_ParentIdGetModel entity2dept_ParentIdGetModel(DeptEntity entity, Integer total, Integer changeCount, Map<String, Object> query) {
        List<DeptEntityExt> extList = new ArrayList<>();
        if (entity == null) return extList2dept_ParentIdGetModel(extList, total, changeCount, query);
        extList.add(HzhrJsonUtil.convertObjectType(entity, DeptEntityExt.class));
        return extList2dept_ParentIdGetModel(extList, total, changeCount, query);
     }
    public DeptEntity dept_ParentIdPutModel2entity(Dept_ParentIdPutModel in) {
        //未转换字段: createUserId code level updateUserId isValid updateTime parentName companyId resourceCode createTime name outId id state 
        if (in == null) return null;
        DeptEntity result = new DeptEntity();

        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        return result;
    }
    public DeptEntity dept_ParentIdPutModel2entity(Dept_ParentIdPutModel in, DeptEntity ori) {
        //未转换字段: createUserId code level updateUserId isValid updateTime parentName companyId resourceCode createTime name outId id state 
        if (in == null) return null;
        DeptEntity result = ori;

        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        return result;
    }
    public List<DeptEntity> dept_ParentIdPutModelList2entityList(List<Dept_ParentIdPutModel> in) {
        if (in == null) return null;
        List<DeptEntity> result = new ArrayList<>();
        for (Dept_ParentIdPutModel item : in) {
            result.add(dept_ParentIdPutModel2entity(item));
        }
        return result;
    }
    public Dept_ParentIdPutModel entity2dept_ParentIdPutModel(DeptEntity in) {
        //未转换字段: 
        if (in == null) return null;
        Dept_ParentIdPutModel result = new Dept_ParentIdPutModel();

        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        return result;
    }
    public List<Dept_ParentIdPutModel> entityList2dept_ParentIdPutModelList(List<DeptEntity> in) {
        if (in == null) return null;
        List<Dept_ParentIdPutModel> result = new ArrayList<>();
        for (DeptEntity item : in) {
            result.add(entity2dept_ParentIdPutModel(item));
        }
        return result;
    }
    public Dept_ParentIdPutModel ext2dept_ParentIdPutModel(DeptEntityExt in) {
        //未转换字段: 
        if (in == null) return null;
        Dept_ParentIdPutModel result = new Dept_ParentIdPutModel();

        result.setParentId(HzhrTypeUtil.integer2integer(in.getParentId()));
        return result;
    }
    public List<Dept_ParentIdPutModel> extList2dept_ParentIdPutModelList(List<DeptEntityExt> in) {
        if (in == null) return null;
        List<Dept_ParentIdPutModel> result = new ArrayList<>();
        for (DeptEntityExt item : in) {
            result.add(ext2dept_ParentIdPutModel(item));
        }
        return result;
    }
    public DeptCustomQueryModel deptService_query2queryModel(Map<String, Object> query) {
        DeptCustomQueryModel queryModel = new DeptCustomQueryModel();

        Integer _equal_id = HzhrTypeUtil.object2integer(query.get("_equal_id"));
        if (_equal_id != null) {
            queryModel.setEqual_id(_equal_id);
         }

        String _equal_name = HzhrTypeUtil.object2string(query.get("_equal_name"));
        if (_equal_name != null) {
            queryModel.setEqual_name(_equal_name);
         }

        Integer _equal_companyId = HzhrTypeUtil.object2integer(query.get("_equal_companyId"));
        if (_equal_companyId != null) {
            queryModel.setEqual_companyId(_equal_companyId);
         }

        Integer _equal_level = HzhrTypeUtil.object2integer(query.get("_equal_level"));
        if (_equal_level != null) {
            queryModel.setEqual_level(_equal_level);
         }

        Integer _equal_parentId = HzhrTypeUtil.object2integer(query.get("_equal_parentId"));
        if (_equal_parentId != null) {
            queryModel.setEqual_parentId(_equal_parentId);
         }

        String _like_resourceCode = HzhrTypeUtil.object2string(query.get("_like_resourceCode"));
        if (_like_resourceCode != null) {
            queryModel.setLike_resourceCode(_like_resourceCode);
         }

        List _in_id = HzhrTypeUtil.object2list(query.get("_in_id"));
        if (_in_id != null) {
            queryModel.setIn_id(_in_id);
         }

        String _like_code = HzhrTypeUtil.object2string(query.get("_like_code"));
        if (_like_code != null) {
            queryModel.setLike_code(_like_code);
         }

        String _equal_code = HzhrTypeUtil.object2string(query.get("_equal_code"));
        if (_equal_code != null) {
            queryModel.setEqual_code(_equal_code);
         }

        Integer _lessthanorequal_level = HzhrTypeUtil.object2integer(query.get("_lessthanorequal_level"));
        if (_lessthanorequal_level != null) {
            queryModel.setLessthanorequal_level(_lessthanorequal_level);
         }

        Boolean _show_subCompanyName = HzhrTypeUtil.object2boolean(query.get("_show_subCompanyName"));
        if (_show_subCompanyName != null && _show_subCompanyName) {
            queryModel.setShow(true);
        }
        Boolean _show_info = HzhrTypeUtil.object2boolean(query.get("_show_info"));
        if (_show_info != null && _show_info) {
            queryModel.setShow(true);
            queryModel.setShow(true);
            queryModel.setShow(true);
            queryModel.setShow(true);
            queryModel.setShow(true);
            queryModel.setShow(true);
            queryModel.setShow(true);
        }
        Boolean _show_managementName = HzhrTypeUtil.object2boolean(query.get("_show_managementName"));
        if (_show_managementName != null && _show_managementName) {
            queryModel.setShow(true);
        }

        Integer page = HzhrTypeUtil.object2integer(query.get("_page"));
        Integer count = HzhrTypeUtil.object2integer(query.get("_count"));
        queryModel.setPage(page, count);

        return queryModel;
    }
    public DeptCustomQueryModel dept_NameService_query2queryModel(Map<String, Object> query) {
        DeptCustomQueryModel queryModel = new DeptCustomQueryModel();

        Integer _equal_id = HzhrTypeUtil.object2integer(query.get("_equal_id"));
        if (_equal_id != null) {
            queryModel.setEqual_id(_equal_id);
         }

        Boolean _show_info = HzhrTypeUtil.object2boolean(query.get("_show_info"));
        if (_show_info != null && _show_info) {
            queryModel.setShow(true);
            queryModel.setShow(true);
        }

        Integer page = HzhrTypeUtil.object2integer(query.get("_page"));
        Integer count = HzhrTypeUtil.object2integer(query.get("_count"));
        queryModel.setPage(page, count);

        return queryModel;
    }
    public DeptCustomQueryModel dept_ParentIdService_query2queryModel(Map<String, Object> query) {
        DeptCustomQueryModel queryModel = new DeptCustomQueryModel();

        Integer _equal_id = HzhrTypeUtil.object2integer(query.get("_equal_id"));
        if (_equal_id != null) {
            queryModel.setEqual_id(_equal_id);
         }

        Boolean _show_info = HzhrTypeUtil.object2boolean(query.get("_show_info"));
        if (_show_info != null && _show_info) {
            queryModel.setShow(true);
        }

        Integer page = HzhrTypeUtil.object2integer(query.get("_page"));
        Integer count = HzhrTypeUtil.object2integer(query.get("_count"));
        queryModel.setPage(page, count);

        return queryModel;
    }

}

